<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/commonList.jsp"%>
<%@ include file="/commons/commonEdit.jsp" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>选择房间</title>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/common/prototype.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/div/common.js"></script>
<script>
var houseId = null;
var houseNum = null;
var customerName = null;
function saveHouseSelect(){
    	if(houseId == null){
			alert("请选择一个房屋");
    		return;
    	}
	   //获取选择房屋的客户姓名
	   var url = "${ctx}/customer_customerAction.do?method=queryCustomerHouse";
	   var str = "houseNumber="+houseNum;
	   new Ajax.Request(url,{method: 'post', parameters: str, onComplete: setCustomerName});
}
function setCustomerName(_response){
		var obj=eval('(' + _response.responseText + ')');
		customerName = typeof(obj.ownerName) == 'undefined'? "" : obj.ownerName;
		setParentHouseInfo();
}
function setParentHouseInfo(){
    	var obj = findFrame("houseChoose");
    	if(customerName != null) obj.setHouseInfo(houseId,houseNum,customerName);
		else obj.setHouseInfo(houseId,houseNum);
        windowClose();
}
function setSelectedHouseInfo(id,number){
		houseId = id;
		houseNum = number;
}
</script>
</head>

<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td class="window_head_outBg"><table border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><span class="window_head_intext"><img src="${ctx}/images/ico_Advance.gif" align="absmiddle">&nbsp;选择房间</span></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td class="aux_header_line_1"></td>
  </tr>
  <tr>
    <td class="aux_header_line_2"></td>
  </tr>
  <tr>
    <td class="content"><table width="100%" border="0" cellspacing="0" cellpadding="0">

	  <tr>
        <td class="aux_outtable_color"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr class="aux_titletable">
            <td>管理房：${coalitionHouseNumber} </td>
          </tr>
          <tr>
            <td>
       		  <c:forEach items="${houseList}" var="house" varStatus="status">
              <input type="radio" name="house" value="${house.houseNumber}" onclick="setSelectedHouseInfo('${house.keyword}','${house.houseNumber}')">
              ${house.houseNumber} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              </c:forEach>
             </td>
          </tr>

        </table></td>
	  </tr>
    </table></td>
  </tr>
  <tr>
    <td colspan="2" class="window_footer">      <table border="0" cellspacing="0" cellpadding="0">
        <tr>
		  <td><table border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td class="buttonOffLeft" id="btn1_21"></td>
                <td class="buttonOffMiddle" id="btn1_22" onClick="saveHouseSelect();" onMouseOver="btn_change_over(2)" onMouseOut="btn_change_out(2)" onBlur="btn_change(2)"><img src="${ctx}/images/ico_ok.gif" alt="" width="14" height="14" border="0" align="absbottom"> 保 存</td>
                <td class="buttonOffRight" id="btn1_23"></td>
              </tr>
          </table></td>
          <td class="btn_between_space"></td>
          <td><table border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td class="buttonOffLeft" id="btn1_31"></td>
                <td class="buttonOffMiddle" id="btn1_32" onClick="windowClose();" onMouseOver="btn_change_over(3)" onMouseOut="btn_change_out(3)" onBlur="btn_change(3)"><img src="${ctx}/images/ico_cancel.gif" alt="" width="14" height="14" border="0" align="absbottom"> 关 闭</td>
                <td class="buttonOffRight" id="btn1_33"></td>
              </tr>
          </table></td>
        </tr>
          </table>
      <p>&nbsp;</p></td>
  </tr>
</table>
</body>
</html>